package cn.anquing.datastructure.binarysearch;

import java.util.Comparator;

/**
 * 测试类
 * @author wangquanqing
 * @since 2021/3/24 16:21
 */
public class Main {

    public static void main(String[] args) {

        Integer[] list = {1,2,3,4,5,6,7,8};
        final int search1 = BinarySearch.search(list, Comparator.comparing(Integer::intValue), 5);
        final int search2 = BinarySearch.search(list, Comparator.comparing(Integer::intValue),5,0,list.length-1);

        System.out.println(search1);
        System.out.println(search2);
    }
}
